package com.fy.fyspace.model.enums.upload;

/**
 * 上传类型枚举
 */
public enum UploadTypeEnum {
  FILE_UPLOAD(0, "文件上传"),
  URL_UPLOAD(1, "URL上传");

  private final Integer code;
  private final String desc;

  UploadTypeEnum(Integer code, String desc) {
    this.code = code;
    this.desc = desc;
  }

  public Integer getCode() {
    return code;
  }

  public String getDesc() {
    return desc;
  }

  public static UploadTypeEnum getByCode(Integer code) {
    for (UploadTypeEnum value : values()) {
      if (value.getCode().equals(code)) {
        return value;
      }
    }
    return null;
  }
}